Repository navigation
Updater: Update pressed while the release check runs starts by itself; one press applies role changes - #496
Merged
Merged
Conversation
… once it passes Pressing Update before the release's signature and model check finished raised ModelsBlocked, the gateway turned it into a 400 and the dashboard showed a red toast, although nothing was wrong. The updater now records the press (who, which version, when) and answers state checking; when the check passes (confirm_check, models_verified, model_check, status or the tick) it carries on into begin as if the admin pressed again, and a failed check ends the press with the check's reason. Another press or a newer release replaces it; a press for the update in progress answers with that update. The gateway answers the remaining state refusals (model check, release not ready) with a 409 that carries the state.
…an install check The next release's release check, while it ran or after it stopped without an answer, was listed under Install health as a Warning with a How to fix and a link to the page it was on, repeating the update card. It is now no install check at all: the Version card shows it, and the preflight still holds the update. A model the release calls that is refused stays a failing check.
…plies An update that changed what CoderHelm's own roles may do took three steps: Update, Review and apply, Confirm and apply. The dashboard now says next to Update that one press includes those changes (always inside the permissions boundary), and sends accept_permissions; the updater records that consent on the update and applies a permission-only change set as soon as it is prepared. Data changes still stop for an explicit confirm of exactly those changes, a change to the deploy role or the boundary still goes to an AWS admin, and the maintenance window never carries a press's consent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pressing Update while a new release's signature and model check was still running showed a red error toast ("Checking vX's signature and the models it calls first; try Update now again in a few minutes."). The updater raised
ModelsBlocked, the gateway turned it into a 400, and the dashboard showed it as an error, although nothing was wrong. Pressing again a few minutes later then worked, which is the "click Update twice" the owner saw.Now the press is recorded and carried through: the update starts by itself once the check passes, exactly as if the admin pressed again.
Changes
lambda/updater/handler.pyupdate_nowwith a pending check recordsUPDATE_REQUEST(who, which version, when) and answersokwithstate: "checking", the request and the check. A release still publishing, or whose template isn't verified yet (ReleaseNotReady), is recorded the same way instead of being refused.follow_requestcarries a waiting press on whenever the check result arrives:confirm_check(aftermodels_verified), the failedmodels_verifiedbranch,model_check,statusand the hourly tick. A passing check callsbeginwith the admin as the actor, so the update then applies or waits for the OK as usual. A failed or stalled check, a refused model or a refusal frombeginends the press with its reason (status: ended). A newer release, or another press, replaces the waiting press. A press whose check never ends is dropped after 2 hours.state: "started"), never "an update is already running". Another version running is refused with a sentence that says what to do.statusreturnsupdate_request(while it waits, and for a day after it ended) for the dashboard card.services/gateway/src/routes/system.rs: anokanswer is a 200 whatever state it names. A refusal that is the install's state (the model check holds it, or the release isn't ready,waiting) is a 409 carrying that state; other refusals stay 400.begin(consent=),consented,native_hold): the dashboard sendsaccept_permissionswith Update, next to text saying one press includes changes to what CoderHelm's own roles may do. The updater recordsconsent(who, when) on the update; a prepared change set whose only holds arepermission_changesthen applies at once, andconfirmedrecords what the press agreed to.data_changesstill stop for the confirm token of exactly those changes;admin_changes(deploy role, boundary) still go to an AWS admin; the maintenance window never carries a press's consent, so a scheduled update still holds for permission changes. The waiting press (UPDATE_REQUEST) keeps the consent.services/gateway/src/routes/setup_checks.rs: the next release's check, running or stalled, is no longer an install check (it was a Warning with a How to fix linking to the same page); the update card shows it, and the preflight still holds the update. A refused model stays a failing check.services/gateway/src/routes/system.rs: passesaccept_permissionsthrough.docs/self-host/updates.md,troubleshooting.md: the one-decision flow; what pressing Update while the check runs does, and that a newer release is only mentioned while an update runs.The dashboard side is CoderHelm/coderhelm#329 (merged as 3f185a6);
selfhost/versions.jsonpins it (scripts/bump-dashboard.sh). Main (with #495) is merged into this branch, no force push.Verification
python3 -m unittest discover -s lambda/tests: 371 tests pass. NewPressDuringCheckclass:state: "checking", actor, version, time,statusshows it);status;checkinginstead of raising.test_updater_native.py: a press that agreed applies a permission-only change set in one go and records it; the press never agrees to data changes or a role or boundary change; the window never carries it;update_nowpasses it on. 376 tests pass.cargo test(gateway, 745 pass): the pending and stalled release check are no install check.cargo fmt,cargo clippy --all-targets -- -D warningsandcargo test system::on the gateway pass. New test: a recorded press is a 200; a waiting release and a model-check refusal are 409s with their state.